﻿<%@ Register TagPrefix="ucCommon" TagName="Common" Src="../Common/Inc/Common.ascx" %>
<%@ Register TagPrefix="ucTop" TagName="Top" Src="../Common/Inc/Top.ascx" %>
<%@ Register TagPrefix="ucMenu" TagName="Menu" Src="../Common/Inc/Menu.ascx" %>
<%@ Register TagPrefix="ucTabTitle" TagName="TabTitle" Src="../Common/Inc/TabTitle.ascx" %>
<%@ Register TagPrefix="ucCopyright" TagName="Copyright" Src="../Common/Inc/Copyright.ascx" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Com1011m.aspx.cs" Inherits="Updms.Com.Com1011m" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>▒ UPDMS [Com1011m] ▒▒▒▒▒▒▒▒▒▒</title>
<ucCommon:Common id="Common" runat="server"></ucCommon:Common>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" id="ScriptManager1" EnableScriptGlobalization="true"></asp:ScriptManager>

<table id="table_frame">
	<tr>
		<td id="top_area" colspan="2">
			<!-- Top 시작 -->
			<ucTop:Top id="Top" runat="server"></ucTop:Top>
			<!-- Top 끝 -->
		</td>
	</tr>
	<tr>
		<td id="menu_area">
			<!-- 메뉴 시작 -->
			<ucMenu:Menu id="Menu" runat="server"></ucMenu:Menu>
			<!-- 메뉴 끝 -->
		</td>
		<td id="contents_area">
			<!-- 제목 시작 -->
			<ucTabTitle:TabTitle id="TabTitle" TagPrefixs="Com1011m" runat="server"></ucTabTitle:TabTitle>
			<!-- 제목 끝 -->
			<!-- AJAX 시작 -->
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">
			<Triggers>
				<asp:PostBackTrigger ControlID="ibtn_excel"/>
			</Triggers>
			<ContentTemplate>
			<!-- 버튼 시작 -->
			<div class="button_area">
				<asp:linkbutton id="ibtn_excel" Text="엑셀" runat="server" CssClass="ibtn ibtn_excel" OnClick="ibtn_excel_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_view_order" Text="정렬" runat="server" CssClass="ibtn ibtn_move" OnClientClick="goMenuViewOrderPage()"></asp:linkbutton>
				<asp:linkbutton id="ibtn_delete" Text="삭제" runat="server" CssClass="ibtn ibtn_delete" OnClientClick="return chkDelete()" OnClick="ibtn_delete_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_save" Text="저장" runat="server" CssClass="ibtn ibtn_save" OnClientClick="return chkSave()" OnClick="ibtn_save_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_search" Text="검색" runat="server" CssClass="ibtn ibtn_search" OnClick="ibtn_search_Click"></asp:linkbutton>
			</div>
			<!-- 버튼 끝 -->
			<!-- 검색 시작 -->
			<table class="table_search">
				<tr>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_search_pgm_class" Text="시스템" runat="server" /></td>
					<td class="ctl" width="22%"><asp:dropdownlist id="ddl_search_pgm_class" CssClass="ddl che" runat="server"></asp:dropdownlist></td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_search_pgm_nm" Text="프로그램명" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_search_pgm_nm" runat="server" CssClass="ib_b" Width="98%"></asp:textbox></td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_search_access_level" Text="접근권한" runat="server" /></td>
					<td class="ctl" width="22%"><asp:dropdownlist id="ddl_search_access_level" runat="server" CssClass="ddl">
							<asp:ListItem Value="">---SELECT---</asp:ListItem>
							<asp:ListItem Value="1">1</asp:ListItem>
							<asp:ListItem Value="2">2</asp:ListItem>
							<asp:ListItem Value="3">3</asp:ListItem>
							<asp:ListItem Value="4">4</asp:ListItem>
							<asp:ListItem Value="5">5</asp:ListItem>
							<asp:ListItem Value="6">6</asp:ListItem>
							<asp:ListItem Value="7">7</asp:ListItem>
							<asp:ListItem Value="8">8</asp:ListItem>
							<asp:ListItem Value="9">9</asp:ListItem>
						</asp:dropdownlist></td>
				</tr>
			</table>
			<!-- 검색 끝 -->
			<!-- 디테일1 시작 -->
			<table class="table_detail">
				<tr>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_pgm_id" Text="아이디" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_pgm_id" runat="server" CssClass="ib_b req" Width="98%"></asp:textbox></td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_pgm_class" Text="시스템" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_pgm_class" runat="server" CssClass="ib_b req" Width="98%"></asp:textbox></td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_pgm_nm" Text="프로그램명" runat="server" /></td>
					<td class="ctl" width="22%">
						<ul class="horizontal">
							<li style="width:50%;"><asp:textbox id="txt_pgm_nm" runat="server" CssClass="ib_b req" Width="96%"></asp:textbox></li>
							<li style="width:50%;"><asp:textbox id="txt_pgm_nm_eng" runat="server" CssClass="ib_b" Width="97%"></asp:textbox></li>
						</ul>
					</td>
				</tr>
				<tr>
					<td class="lbl"><asp:Literal ID="ltr_pgm_url" Text="URL" runat="server" /></td>
					<td class="ctl"><asp:textbox id="txt_pgm_url" runat="server" CssClass="ib_b" Width="98%"></asp:textbox></td>
					<td class="lbl"><asp:Literal ID="ltr_pgm_div" Text="구분" runat="server" /></td>
					<td class="ctl"><asp:dropdownlist id="ddl_pgm_div" runat="server" CssClass="ddl">
							<asp:ListItem Value="D">[D] Directory</asp:ListItem>
							<asp:ListItem Value="F" Selected="True">[F] File</asp:ListItem>
						</asp:dropdownlist></td>
					<td class="lbl"><asp:Literal ID="ltr_dir_depth" Text="계층구조" runat="server" /></td>
					<td class="ctl"><asp:textbox id="txt_dir_depth" runat="server" CssClass="ib_b req" Width="98%"></asp:textbox></td>
				</tr>
				<tr>
					<td class="lbl"><asp:Literal ID="ltr_access_level" Text="접근권한" runat="server" /></td>
					<td class="ctl">
						<ul class="horizontal">
							<li><asp:textbox id="txt_access_level" runat="server" Width="20" CssClass="ib_read_only"></asp:textbox></li>
							<li style="width:4px;height:23px">&nbsp;</li>
							<li><asp:textbox id="txt_access_level_slider" runat="server"></asp:textbox></li>
						</ul>
					</td>
					<td class="lbl"><asp:Literal ID="ltr_use_yn" Text="사용여부" runat="server" /></td>
					<td class="ctl"><asp:radiobuttonlist id="rbl_use_yn" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="rbl_flow">
							<asp:ListItem Value="Y" Selected="True">Y</asp:ListItem>
							<asp:ListItem Value="N">N</asp:ListItem>
						</asp:radiobuttonlist></td>
					<td class="lbl"><asp:Literal ID="ltr_exp_yn" Text="대표여부" runat="server" /></td>
					<td class="ctl"><asp:radiobuttonlist id="rbl_exp_yn" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="rbl_flow">
							<asp:ListItem Value="Y">Y</asp:ListItem>
							<asp:ListItem Value="N" Selected="True">N</asp:ListItem>
						</asp:radiobuttonlist></td>
				</tr>
			</table>
			<!-- 디테일1 끝 -->
			<!-- 리스트셋 시작 -->
			<table cellpadding="0" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<!-- 검색어 시작 -->
						<div class="div_left">Keyword : <asp:label id="lbl_search_keyword" runat="server"></asp:label></div>
						<div class="div_right"><asp:checkbox id="cb_list_all" runat="server" AutoPostBack="True" OnCheckedChanged="cb_list_all_CheckedChanged" ToolTip="Show All"></asp:checkbox></div>
						<!-- 검색어 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 리스트 시작 -->
						<asp:GridView ID="GridView1" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand" DataKeyNames="Seq">
							<Columns>
								<asp:TemplateField HeaderText="&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;checkBoxCheck('GridView1');&quot;&gt;S&lt;/a&gt;">
									<ItemTemplate>
										<input id="cb_check" class="cb" type="checkbox" onclick="reverseRow('GridView1', 0);" runat="server" />
									</ItemTemplate>
									<ItemStyle HorizontalAlign="Center" Width="2%" />
								</asp:TemplateField>
								<asp:BoundField HeaderText="번호" >
									<ItemStyle HorizontalAlign="Center" Width="4%" />
								</asp:BoundField>
								<asp:BoundField DataField="Seq" HeaderText="Seq(X)" Visible="False" />
								<asp:TemplateField HeaderText="아이디">
									<ItemStyle HorizontalAlign="Center" Width="8%" />
									<HeaderStyle CssClass="lbtn_rc" />
									<ItemTemplate>
										<asp:LinkButton ID="lbtn_rc" runat="server" Text='<%# Bind("Pgm_Id") %>'></asp:LinkButton>
									</ItemTemplate>
								</asp:TemplateField>
								<asp:BoundField DataField="Pgm_Class" HeaderText="시스템" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Center" Width="8%" />
								</asp:BoundField>
								<asp:BoundField DataField="Pgm_Nm" HeaderText="프로그램명" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Left" Width="18%" />
								</asp:BoundField>
								<asp:BoundField DataField="Pgm_Nm_Eng" HeaderText="프로그램영문명" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Left" Width="16%" />
								</asp:BoundField>
								<asp:BoundField DataField="Pgm_Url" HeaderText="URL" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Left" Width="14%" />
								</asp:BoundField>
								<asp:BoundField DataField="Pgm_Div" HeaderText="구분" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Center" Width="5%" />
								</asp:BoundField>
								<asp:BoundField DataField="Dir_Depth" HeaderText="계층구조" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Center" Width="5%" />
								</asp:BoundField>
								<asp:BoundField DataField="Access_Level" HeaderText="접근권한" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Center" Width="8%" />
								</asp:BoundField>
								<asp:BoundField DataField="Use_Yn" HeaderText="사용여부" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Center" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="Exp_Yn" HeaderText="대표여부" HtmlEncode="False">
									<ItemStyle HorizontalAlign="Center" Width="6%" />
								</asp:BoundField>
							</Columns>
							<EmptyDataTemplate>
								<div id="no_data"></div>
							</EmptyDataTemplate>
						</asp:GridView>
						<!-- 리스트 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 페이징 시작 -->
						<div class="div_left">Result : <asp:label id="lbl_result_count" runat="server"></asp:label></div>
						<div class="div_right"><asp:label id="lbl_page" runat="server"></asp:label></div>
						<!-- 페이징 끝 -->
					</td>
				</tr>
			</table>
			<!-- 리스트셋 끝 -->
			<!-- 카피라이트 시작 -->
			<ucCopyright:Copyright id="Copyright" runat="server"></ucCopyright:Copyright>
			<!-- 카피라이트 끝 -->
			<!-- 히든값 시작 -->
			<div id="hdn_data">
				<asp:label id="lbl_pk" runat="server"></asp:label>
				<asp:Label id="lbl_search_flag" runat="server"></asp:Label>
				<input id="h_no" type="hidden" name="h_no" runat="server" />
			</div>
			<!-- 히든값 끝 -->
			<!-- 자동완성 시작 -->
			<act:AutoCompleteExtender ID="ace_search_pgm_nm"
				runat="server"
				TargetControlID="txt_search_pgm_nm"
				ServiceMethod="GetSearchData"
				ServicePath="../Common/Inc/AutoCompleteWebService.asmx"
				MinimumPrefixLength="1"
				CompletionSetCount="20"
				CompletionInterval="800"
				EnableCaching="true"
				UseContextKey="true"
				ContextKey="Com1011m"
				CompletionListCssClass="ace_List"
				CompletionListItemCssClass="ace_ListItem"
				CompletionListHighlightedItemCssClass="ace_HighlightedItem" >
			</act:AutoCompleteExtender>
			<!--슬라이더-->
			<act:SliderExtender ID="se_access_level" runat="server"
				TargetControlID="txt_access_level_slider"
				BoundControlID="txt_access_level"
				BehaviorID="AccessLevelSlider"
				EnableHandleAnimation="true"
				TooltipText="{0}"
				Length="200"
				Decimals="0"
				Minimum="1"
				Maximum="9" />
			</ContentTemplate>
			</asp:UpdatePanel>
			<!-- AJAX 끝 -->
		</td>
	</tr>
</table>

<asp:updateprogress AssociatedUpdatePanelID="UpdatePanel1" ID="updateProgress" runat="server">
	<progresstemplate>
		<div id="progressBackgroundFilter"></div>
		<div id="processMessage">
			<div id="processing"></div>
			<img src="../Common/Images/processing_img.gif" />
		</div>
	</progresstemplate>
</asp:updateprogress>

</form>
<script type="text/javascript" language="javascript" defer="defer">
	//저장
	function chkSave() {
		if ($F("txt_pgm_id").blank()) {
			msgBox.alert(getMsg(MSG_ERR_005), setFocus, "txt_pgm_id"); //프로그램 아이디를 입력해 주세요
			return false;
		}
		if ($F("txt_pgm_class").blank()) {
			msgBox.alert(getMsg(MSG_ERR_006), setFocus, "txt_pgm_class"); //시스템을 입력해 주세요
			return false;
		}
		if ($F("txt_pgm_nm").blank()) {
			msgBox.alert(getMsg(MSG_ERR_007), setFocus, "txt_pgm_nm"); //프로그램명을 입력해 주세요
			return false;
		}
		if ($F("txt_dir_depth").blank()) {
			msgBox.alert(getMsg(MSG_ERR_192), setFocus, "txt_dir_depth"); //계층구조를 입력해 주세요
			return false;
		}

		//계층구조값의 정합성 체크
		var dir_depth_val = $("txt_dir_depth").value;
		if (dir_depth_val.match("^[D][0-9]{2,2}[0-9]{4,4}$") == null) {
			msgBox.alert(getMsg(MSG_ERR_193), setFocus, "txt_dir_depth"); //계층구조 형식을 확인해주세요\n(ex: D010001)
			return false;
		}

		var pk = $get("lbl_pk").innerHTML;
		var MSG_ID = (pk == "") ? MSG_CFM_000 : MSG_CFM_028; //저장/수정
		msgBox.confirm(getMsg(MSG_ID), doSave); //저장하시겠습니까?

		return false;
	}

	//리스트 선택시 슬라이드값 설정
	function setSliderValue(v, id) {
		var sliderbehaviour = $find(id);
		if (sliderbehaviour != null) {
			sliderbehaviour.set_Value(v);
		}
	}
	
	//삭제
	function chkDelete() {
		if(!isCheckedOnGridView("GridView1", 0)) {
			msgBox.alert(getMsg(MSG_ERR_053));	//삭제할 항목을 선택하세요
			return false;
		}
		msgBox.confirm(getMsg(MSG_CFM_001), doDelete);	//삭제하시겠습니까?
		return false;
	}
	
</script>
</body>
</html>